<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page import="com.teachoa.bean.User" %>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>文化创意产业项目虚拟仿真实验教学系统</title>
<jsp:include page="/header.jsp"/>
<script type="text/javascript">
	function menuJump(a) {
		var url = $(a).attr("url");
		$("#content").load(url);
	}
	
	function pwdView() {
		$("#pwd-dialog").modal("show");
	}
	
	function changePwd() {
		var newpwd = $("#new-pwd").val();
		var repwd = $("#re-pwd").val();
		if(newpwd!=repwd) alert("两次密码不一致");
		else {
			$.ajax({
				url:"/user/pwd",
				type:"post",
				data:{oldpwd:$("#old-pwd").val(),newpwd:newpwd},
				dataType:"json"
			}).done(function(data){
				alert(data.msg);
				if(data.isSuccess) {
					$("#pwd-dialog").modal("hide");
					window.location = "/";
				}
			})
		}
	}
</script>
</head>
<body>
	<!-- topbar starts -->
    <div class="navbar navbar-default" role="navigation">

        <div class="navbar-inner">
            <button type="button" class="navbar-toggle pull-left animated flip">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="/main"> <img alt="Charisma Logo" src="img/logo20.png" class="hidden-xs"/>
                <span>文化创意产业项目虚拟仿真实验教学系统</span></a>

            <!-- user dropdown starts -->
            <div class="btn-group pull-right">
                <button class="btn btn-default dropdown-toggle" data-toggle="dropdown">
                    <i class="glyphicon glyphicon-user"></i><span class="hidden-sm hidden-xs"> admin</span>
                    <span class="caret"></span>
                </button>
                <ul class="dropdown-menu">
                    <!-- <li><a href="#">Profile</a></li>
                    <li class="divider"></li> -->
                    <li><a href="javascript:;" onclick="pwdView();">修改密码</a></li>
                    <li><a href="/logout">退出登录</a></li>
                </ul>
            </div>
            <!-- user dropdown ends -->

            <!-- theme selector starts -->
            <div class="btn-group pull-right theme-container animated tada">
                <button class="btn btn-default dropdown-toggle" data-toggle="dropdown">
                    <i class="glyphicon glyphicon-tint"></i><span
                        class="hidden-sm hidden-xs"> 更换主题</span>
                    <span class="caret"></span>
                </button>
                <ul class="dropdown-menu" id="themes">
                    <li><a data-value="classic" href="#"><i class="whitespace"></i> Classic</a></li>
                    <li><a data-value="cerulean" href="#"><i class="whitespace"></i> Cerulean</a></li>
                    <li><a data-value="cyborg" href="#"><i class="whitespace"></i> Cyborg</a></li>
                    <li><a data-value="simplex" href="#"><i class="whitespace"></i> Simplex</a></li>
                    <li><a data-value="darkly" href="#"><i class="whitespace"></i> Darkly</a></li>
                    <li><a data-value="lumen" href="#"><i class="whitespace"></i> Lumen</a></li>
                    <li><a data-value="slate" href="#"><i class="whitespace"></i> Slate</a></li>
                    <li><a data-value="spacelab" href="#"><i class="whitespace"></i> Spacelab</a></li>
                    <li><a data-value="united" href="#"><i class="whitespace"></i> United</a></li>
                </ul>
            </div>
            <!-- theme selector ends -->

            <!-- <ul class="collapse navbar-collapse nav navbar-nav top-menu">
                <li><a href="#"><i class="glyphicon glyphicon-globe"></i> Visit Site</a></li>
                <li class="dropdown">
                    <a href="#" data-toggle="dropdown"><i class="glyphicon glyphicon-star"></i> Dropdown <span
                            class="caret"></span></a>
                    <ul class="dropdown-menu" role="menu">
                        <li><a href="#">Action</a></li>
                        <li><a href="#">Another action</a></li>
                        <li><a href="#">Something else here</a></li>
                        <li class="divider"></li>
                        <li><a href="#">Separated link</a></li>
                        <li class="divider"></li>
                        <li><a href="#">One more separated link</a></li>
                    </ul>
                </li>
                <li>
                    <form class="navbar-search pull-left">
                        <input placeholder="Search" class="search-query form-control col-md-10" name="query"
                               type="text">
                    </form>
                </li>
            </ul> -->

        </div>
    </div>
    <!-- topbar ends -->
<div class="ch-container">
    <div class="row">
        
        <!-- left menu starts -->
        <div class="col-sm-2 col-lg-2">
            <div class="sidebar-nav">
                <div class="nav-canvas">
                    <div class="nav-sm nav nav-stacked">

                    </div>
                    <ul class="nav nav-pills nav-stacked main-menu">
                    <c:forEach items="${menuMap }" var="entry">
                    	<li class="nav-header">${entry.key }</li>
                    	<c:forEach items="${entry.value }" var="menu">
                    	<c:choose>
                    		<c:when test="${menu.name eq '项目管理' }">
                    			<li class="accordion active">
                    			<a href="#"><i class="glyphicon glyphicon-plus"></i><span> 项目管理</span></a>
                    			<c:choose>
                    				<c:when test="${userRole eq 1 }">
                    					<ul class="nav nav-pills nav-stacked" style="display:block;">
			                                <li><a href="#" onclick="menuJump(this);" url="/pro/name">候选项目名称管理</a></li>
			                                <li><a href="#" onclick="menuJump(this);" url="/pro/audit">新项目审批</a></li>
			                                <li><a href="#" onclick="menuJump(this);" url="/pro/teamAudit">项目团队审批</a></li>
			                                <li><a href="#" onclick="menuJump(this);" url="/pro/project">项目列表</a></li>
			                                <!-- <li><a href="#">项目进度监控</a></li>
			                                <li><a href="#">项目明细查看</a></li>
			                                <li><a href="#">项目提问审批管理</a></li> -->
			                            </ul>
                    				</c:when>
                    				<c:when test="${userRole eq 2 }">
                    					<ul class="nav nav-pills nav-stacked" style="display:block;">
			                                <li><a href="#" onclick="menuJump(this);" url="/pro/project">项目列表</a></li>
			                                <li><a href="#" onclick="menuJump(this);" url="/pro/team">项目团队组建</a></li>
			                                <!-- <li><a href="#">项目列表导航</a></li> -->
			                                <!-- <li><a href="#">项目进度查看</a></li>
			                                <li><a href="#">项目明细查看</a></li> -->
			                                <!-- <li><a href="#">执行项目任务</a></li> -->
			                            </ul>
                    				</c:when>
                    				<c:when test="${userRole eq 3 }">
                    					<ul class="nav nav-pills nav-stacked" style="display:block;">
			                                <li><a href="#">项目列表导航</a></li>
			                                <li><a href="#">项目进度查看</a></li>
			                                <li><a href="#">项目节点明细查看</a></li>
			                                <li><a href="#">项目提问意见管理</a></li>
			                            </ul>
                    				</c:when>
                    			</c:choose>
                    			</li>
                    		</c:when>
                    		<%-- <c:when test="${menu.name eq '项目信息发布管理' }">
                    			<li class="accordion">
                    			<a href="#"><i class="glyphicon glyphicon-plus"></i><span> 项目信息发布管理</span></a>
                  				<ul class="nav nav-pills nav-stacked">
	                                <li><a href="#">发布信息</a></li>
	                                <li><a href="#">编辑信息</a></li>
	                                <li><a href="#">删除信息</a></li>
	                                <li><a href="#">查看信息</a></li>
	                            </ul>
	                            </li>
                    		</c:when> --%>
                    		<c:otherwise>
                    		<li><a parent="${entry.key }" href="javascript:;" url="${menu.url }" onclick="menuJump(this);">
                    			<span>${menu.name }</span></a></li>
                    			</c:otherwise>
                    		</c:choose>
                    	</c:forEach>
                    </c:forEach>
                    </ul>
                </div>
            </div>
        </div>
        <!--/span-->
        <!-- left menu ends -->

        <noscript>
            <div class="alert alert-block col-md-12">
                <h4 class="alert-heading">Warning!</h4>

                <p>You need to have <a href="http://en.wikipedia.org/wiki/JavaScript" target="_blank">JavaScript</a>
                    enabled to use this site.</p>
            </div>
        </noscript>

        <div id="content" class="col-lg-10 col-sm-10">
            <jsp:include page="content.jsp"/>
            </div>
</div><!--/fluid-row-->

    <hr>
    <footer class="row">
        <p class="col-md-9 col-sm-9 col-xs-12 copyright">&copy; <a href="http://usman.it" target="_blank">Muhammad
                Usman</a> 2012 - 2014</p>

        <p class="col-md-3 col-sm-3 col-xs-12 powered-by">Powered by: <a
                href="http://usman.it/free-responsive-admin-template">Charisma</a></p>
    </footer>
</div>
<jsp:include page="password.jsp"/>
</body>
</html>